package model

import "time"

// MeteringAccount  金额账户表
type MeteringAccount struct {
	Id        uint64     `gorm:"primary_key" json:"id"`
	Balance   float64    `gorm:"column:balance" json:"balance"`       //余额
	Arrears   float64    `gorm:"column:arrears" json:"arrears"`       //欠费
	CreatedAt time.Time  `gorm:"column:created_at" json:"created_at"` //创建时间
	UpdatedAt time.Time  `gorm:"column:updated_at" json:"updated_at"` //更新时间
	DeletedAt *time.Time `gorm:"column:deleted_at" json:"deleted_at"` //删除时间
}

func (m MeteringAccount) TableName() string {
	return "metering_account"
}

func (m MeteringAccount) ToMap() map[string]interface{} {
	return map[string]interface{}{
		"Id":        m.Id,
		"Balance":   m.Balance,
		"Arrears":   m.Arrears,
		"CreatedAt": m.CreatedAt,
		"UpdatedAt": m.UpdatedAt,
		"DeletedAt": m.DeletedAt,
	}
}
